	
// PostNummer.h : Declaration of the CPostNummer

#ifndef __POSTNUMMER_H_
#define __POSTNUMMER_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CPostNummer
class ATL_NO_VTABLE CPostNummer : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CPostNummer, &CLSID_PostNummer>,
	public ISupportErrorInfo,
	public IDispatchImpl<IPostNummer, &IID_IPostNummer, &LIBID_EBASDLLLib>
{
public:
	CPostNummer()
	{
		m_pUnkMarshaler = NULL;
	}
	virtual ~CPostNummer()
	{

	}


DECLARE_REGISTRY_RESOURCEID(IDR_POSTNUMMER)
DECLARE_GET_CONTROLLING_UNKNOWN()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CPostNummer)
	COM_INTERFACE_ENTRY(IPostNummer)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
END_COM_MAP()

	HRESULT FinalConstruct()
	{
		return CoCreateFreeThreadedMarshaler(
			GetControllingUnknown(), &m_pUnkMarshaler.p);
	}

	void FinalRelease()
	{
		m_pUnkMarshaler.Release();
	}

	CComPtr<IUnknown> m_pUnkMarshaler;

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// IPostNummer
public:
	STDMETHOD(get_Gade)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_Gade)(/*[in]*/ BSTR newVal);
	STDMETHOD(get_By)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_By)(/*[in]*/ BSTR newVal);
	STDMETHOD(get_PostNr)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_PostNr)(/*[in]*/ BSTR newVal);
	STDMETHOD(get_GUID)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_GUID)(/*[in]*/ BSTR newVal);
private:
	bstr_t m_postNr, m_by, m_gade, m_guid;
};

#endif //__POSTNUMMER_H_
